from elixir import *
import elixir as el

class ScaleScores(Entity):
    prorawL = Field(Integer)
    prorawF = Field(Integer)
    prorawK = Field(Integer)
    prorawHS = Field(Integer)
    prorawD = Field(Integer)
    prorawHY = Field(Integer)
    prorawPD = Field(Integer)
    prorawMF = Field(Integer)
    prorawPA = Field(Integer)
    prorawPT = Field(Integer)
    prorawSC = Field(Integer)
    prorawMA = Field(Integer)
    prorawSI = Field(Integer)

    protL = Field(Integer)
    protF = Field(Integer)
    protK = Field(Integer)
    protHS = Field(Integer)
    protD = Field(Integer)
    protHY = Field(Integer)
    protPD = Field(Integer)
    protMF = Field(Integer)
    protPA = Field(Integer)
    protPT = Field(Integer)
    protSC = Field(Integer)
    protMA = Field(Integer)
    protSI = Field(Integer)

    suprawA = Field(Integer)
    suprawR = Field(Integer)
    suprawEs = Field(Integer)
    suprawFB = Field(Integer)
    suprawTR = Field(Integer)
    suprawVR = Field(Integer)
    suprawOH = Field(Integer)
    suprawDo = Field(Integer)
    suprawRE = Field(Integer)
    suprawMt = Field(Integer)
    suprawGM = Field(Integer)
    suprawGF = Field(Integer)
    suprawPK = Field(Integer)
    suprawPS = Field(Integer)
    suprawMACR = Field(Integer)

    suptA = Field(Integer)
    suptR = Field(Integer)
    suptEs = Field(Integer)
    suptFB = Field(Integer)
    suptTR = Field(Integer)
    suptVR = Field(Integer)
    suptOH = Field(Integer)
    suptDo = Field(Integer)
    suptRE = Field(Integer)
    suptMt = Field(Integer)
    suptGM = Field(Integer)
    suptGF = Field(Integer)
    suptPK = Field(Integer)
    suptPS = Field(Integer)
    suptMACR = Field(Integer)

    conrawANX = Field(Integer)
    conrawFRS = Field(Integer)
    conrawOBS = Field(Integer)
    conrawDEP = Field(Integer)
    conrawHEA = Field(Integer)
    conrawBIZ = Field(Integer)
    conrawANG = Field(Integer)
    conrawCYN = Field(Integer)
    conrawASP = Field(Integer)
    conrawTPA = Field(Integer)
    conrawLSE = Field(Integer)
    conrawSOD = Field(Integer)
    conrawFAM = Field(Integer)
    conrawWRK = Field(Integer)
    conrawTRT = Field(Integer)

    contANX = Field(Integer)
    contFRS = Field(Integer)
    contOBS = Field(Integer)
    contDEP = Field(Integer)
    contHEA = Field(Integer)
    contBIZ = Field(Integer)
    contANG = Field(Integer)
    contCYN = Field(Integer)
    contASP = Field(Integer)
    contTPA = Field(Integer)
    contLSE = Field(Integer)
    contSOD = Field(Integer)
    contFAM = Field(Integer)
    contWRK = Field(Integer)
    contTRT = Field(Integer)

    NonKScoreHS = Field(Integer)
    NonKScorePD = Field(Integer)
    NonKScorePT = Field(Integer)
    NonKScoreSC = Field(Integer)
    NonKScoreMA = Field(Integer)

    Draw1 = Field(Integer)
    Draw2 = Field(Integer)
    Draw3 = Field(Integer)
    Draw4 = Field(Integer)
    Draw5 = Field(Integer)

    Dt1 = Field(Integer)
    Dt2 = Field(Integer)
    Dt3 = Field(Integer)
    Dt4 = Field(Integer)
    Dt5 = Field(Integer)

    Hyraw1 = Field(Integer)
    Hyraw2 = Field(Integer)
    Hyraw3 = Field(Integer)
    Hyraw4 = Field(Integer)
    Hyraw5 = Field(Integer)

    Hyt1 = Field(Integer)
    Hyt2 = Field(Integer)
    Hyt3 = Field(Integer)
    Hyt4 = Field(Integer)
    Hyt5 = Field(Integer)

    Pdraw1 = Field(Integer)
    Pdraw2 = Field(Integer)
    Pdraw3 = Field(Integer)
    Pdraw4 = Field(Integer)
    Pdraw5 = Field(Integer)

    Pdt1 = Field(Integer)
    Pdt2 = Field(Integer)
    Pdt3 = Field(Integer)
    Pdt4 = Field(Integer)
    Pdt5 = Field(Integer)

    Paraw1 = Field(Integer)
    Paraw2 = Field(Integer)
    Paraw3 = Field(Integer)

    Pat1 = Field(Integer)
    Pat2 = Field(Integer)
    Pat3 = Field(Integer)

    Scraw1 = Field(Integer)
    Scraw2 = Field(Integer)
    Scraw3 = Field(Integer)
    Scraw4 = Field(Integer)
    Scraw5 = Field(Integer)

    Sct1 = Field(Integer)
    Sct2 = Field(Integer)
    Sct3 = Field(Integer)
    Sct4 = Field(Integer)
    Sct5 = Field(Integer)

    Maraw1 = Field(Integer)
    Maraw2 = Field(Integer)
    Maraw3 = Field(Integer)
    Maraw4 = Field(Integer)

    Mat1 = Field(Integer)
    Mat2 = Field(Integer)
    Mat3 = Field(Integer)
    Mat4 = Field(Integer)

    Siraw1 = Field(Integer)
    Siraw2 = Field(Integer)
    Siraw3 = Field(Integer)

    Sit1 = Field(Integer)
    Sit2 = Field(Integer)
    Sit3 = Field(Integer)

    def __repr__ (self):
        return 'MMPI2 "event_id %d">' %(self.event_id)

class ScaleDbLoader():
    def __init__ (self):
        el.metadata.bind = 'insert correct db info here'
        el.metadata.bind.echo = True

        el.setup_all()
        el.create_all()

    def load_database(self, dictionary):
        scale = ScaleScores()
        scale.from_dict(ProRS)
        scale.from_dict(ProTS)
        scale.from_dict(SupRS)
        scale.from_dict(SupTS)
        scale.from_dict(ConRS)
        scale.from_dict(ConTS)
        scale.from_dict(NonK)
        scale.from_dict(DpR)
        scale.from_dict(DpT)
        scale.from_dict(HyR)
        scale.from_dict(HyT)
        scale.from_dict(PdR)
        scale.from_dict(PdT)
        scale.from_dict(PaR)
        scale.from_dict(PaT)
        scale.from_dict(ScR)
        scale.from_dict(ScT)
        scale.from_dict(MaR)
        scale.from_dict(MaT)
        scale.from_dict(SiR)
        scale.from_dict(SiT)

        session.commit()
  